package com.simple.proxy.mybatis.proxy;

import java.lang.reflect.Proxy;

/**
 * 工具：实例化代理类
 */
public class MapperProxyFactory {

    public static <T> T getMapper(Class<T> mapperInterface) {
        return (T) Proxy.newProxyInstance(mapperInterface.getClassLoader(), new Class[] { mapperInterface }, new MapperProxy());
    }
}
